# -- coding: utf-8 --

import os
from .command import Command

class LsCommand(Command):
    def __init__(self,args):
        Command.__init__(self,args)

    def usage(self):
        print("ls          - listfile in current dir")
        print("ls dir      - listfile in dir")

    def execute(self):
        if len(self.args) == 1:
            path = '.'
        elif len(self.args) == 2:
            path = self.args[1]
        else:
            self.usage()
            return

        dir = os.listdir(path)
        for i in dir:
            print(i)



